package cj.web.kly.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cj.web.kly.dao.MemberDAO;
import cj.web.kly.domain.Member;

@Service
@Transactional
public class MemberService {

	@Autowired
    private MemberDAO memberDAO;
	
	/**
	 * 查询
	 * @param member
	 * @return objLis;size
	 */
	public Map query(Member member){
		Map rep = new HashMap();
		List<Member> objLis = memberDAO.queryByPhone(member);
		int size = memberDAO.queryByPhoneSize(member); 
		rep.put("objLis", objLis);
		rep.put("size", size);
		return rep;
    }
	
	public Member queryByPhone(String phone){
		Member obj = memberDAO.queryByPhone(phone);
		return obj;
    }
	
	public Member queryById(int id){
		Member obj = memberDAO.queryById(id);
		return obj;
    }
	
	public void create(Member member){
		memberDAO.create(member);
	}
	
	public void update(Member member){
		memberDAO.update(member);
	}
	
	public void deleteById(int id){
		memberDAO.deleteById(id);
	}
	
	public void updateErrorById(int id,String pwd){
		memberDAO.updateErrorById(id,pwd);
	}
}